/**
 * 
 */
package com.totobox.apps.common;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.RadioButton;

import com.totobox.apps.Const;
import com.totobox.apps.R;
import com.totobox.apps.activity.TotoFileConfirmActivity;

/**
 * @author ytslove
 * 
 */
public class MovieCustomDialog extends Dialog {

	private ImageButton alert_cencel;
	private RadioButton radio_normal;
	private RadioButton radio_high;
	private Activity atv;
	
	public MovieCustomDialog(Activity atv) {
		super(atv);
		this.atv = atv;
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		this.setContentView(R.layout.dialog_movie_view);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		radio_normal = (RadioButton)findViewById(R.id.radio_normal);
		radio_high = (RadioButton)findViewById(R.id.radio_high);
		
		radio_normal.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				radio_high.setChecked(false);
				Const.MODE = "N";
				dismiss();
				
				MoveActivity go = new MoveActivity(atv, TotoFileConfirmActivity.class);
				go.startActivity();
			}
		});
		radio_high.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				radio_normal.setChecked(false);
				Const.MODE = "H";
				dismiss();
				
				MoveActivity go = new MoveActivity(atv, TotoFileConfirmActivity.class);
				go.startActivity();
			}
		});
		
		alert_cencel = (ImageButton)findViewById(R.id.alert_cencel);
		
		alert_cencel.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});
	}

}
